<?php
require_once ("./commun/ouvre_base.php");

// echo "session remplissage fiche : ", $session;

$hash_variables = array (
		"index" => $nouvel_index,
		"date" => $date,
		"center" => strtoupper ( $center ),
		"neurologist" => $neurologist,
		"code1" => $code1,
		"code2" => $code2,
		"code3" => $code3,
		"code4" => $code4,
		"code5" => $code5,
		"birthdate" => $birthdate,
		"proband" => $proband,
		"sex" => $sex,
		"initialexam" => $initialexam,
		"followup" => $followup,
		"ps_or_ataxia_in_family" => $ps_or_ataxia_in_family,
		"other_familial_disease" => $other_familial_disease,
		"specify_other_familial_disease" => $specify_other_familial_disease,
		"consanguinity" => $consanguinity,
		"specify_consanguinity" => $specify_consanguinity,
		"parental_inheritance" => $parental_inheritance,
		"geographical_origin" => strtoupper ( $geographical_origin ),
		"onset_age" => $onset_age,
		"examination_age" => $examination_age,
		"motor_development" => $motor_development,
		"specify_motor_development" => $specify_motor_development,
		"intellect_development" => $intellect_development,
		"specify_intellect_development" => $specify_intellect_development,
		"unsteadiness" => $unsteadiness,
		"age_unsteadiness" => $age_unsteadiness,
		"dysarthria" => $dysarthria,
		"age_dysarthria" => $age_dysarthria,
		"stiff_legs" => $stiff_legs,
		"age_stiff_legs" => $age_stiff_legs,
		"cramps" => $cramps,
		"age_cramps" => $age_cramps,
		"medical_exam" => $medical_exam,
		"age_medical_exam" => $age_medical_exam,
		"pain" => $pain,
		"age_pain" => $age_pain,
		"other_signs_onset" => $other_signs_onset,
		"specify_other_signs_onset" => $specify_other_signs_onset,
		"age_other_signs_onset" => $age_other_signs_onset,
		"spasticity_upper_limbs" => $spasticity_upper_limbs,
		"spasticity_lower_limbs" => $spasticity_lower_limbs,
		"spasticity_gait" => $spasticity_gait,
		"spasticity_dysarthria" => $spasticity_dysarthria,
		"ataxia_upper_limbs" => $ataxia_upper_limbs,
		"ataxia_lower_limbs" => $ataxia_lower_limbs,
		"ataxia_gait" => $ataxia_gait,
		"ataxia_dysarthria" => $ataxia_dysarthria,
		"disability_stage" => $disability_stage,
		"age_disability_stage" => $age_disability_stage,
		"jaw_jerk" => $jaw_jerk,
		"biceps" => $biceps,
		"finger_flexor" => $finger_flexor,
		"patellar" => $patellar,
		"adductor" => $adductor,
		"ankle" => $ankle,
		"hoffmans_sign" => $hoffmans_sign,
		"plantar_reflex" => $plantar_reflex,
		"motor_facial_palsy_atrophy" => $motor_facial_palsy_atrophy,
		"motor_proximal_UL" => $motor_proximal_UL,
		"motor_distal_UL" => $motor_distal_UL,
		"motor_proximal_LL" => $motor_proximal_LL,
		"motor_distal_LL" => $motor_distal_LL,
		"muscle_proximal_UL" => $muscle_proximal_UL,
		"muscle_distal_UL" => $muscle_distal_UL,
		"muscle_proximal_LL" => $muscle_proximal_LL,
		"muscle_distal_LL" => $muscle_distal_LL,
		"fasciculations_myokymias" => $fasciculations_myokymias,
		"fasciculations_myokymias_localisation" => $fasciculations_myokymias_localisation,
		"vibration_sense" => $vibration_sense,
		"superficial_sensory_loss" => $superficial_sensory_loss,
		"scoliosis" => $scoliosis,
		"pes_cavus" => $pes_cavus,
		"other_skeletal_abnormality" => $other_skeletal_abnormality,
		"other_other_skeletal_abnormality" => $other_other_skeletal_abnormality,
		"facial_dysmorphia" => $facial_dysmorphia,
		"describe_facial_dysmorphia" => $describe_facial_dysmorphia,
		"urinary_urgency" => $urinary_urgency,
		"urinary_incontinence" => $urinary_incontinence,
		"urinary_retention" => $urinary_retention,
		"anal_incontinence" => $anal_incontinence,
		"impaired_sexual_function" => $impaired_sexual_function,
		"early_menopause" => $early_menopause,
		"early_menopause_age" => $early_menopause_age,
		"resting_tremor" => $resting_tremor,
		"specify_resting_tremor" => $specify_resting_tremor,
		"postural_tremor" => $postural_tremor,
		"specify_postural_tremor" => $specify_postural_tremor,
		"chorea" => $chorea,
		"specify_chorea" => $specify_chorea,
		"dystonia" => $dystonia,
		"specify_dystonia" => $specify_dystonia,
		"hypokinesia" => $hypokinesia,
		"specify_hypokinesia" => $specify_hypokinesia,
		"rigidity" => $rigidity,
		"specify_rigidity" => $specify_rigidity,
		"diplopia" => $diplopia,
		"ptosis" => $ptosis,
		"bulging_eyes" => $bulging_eyes,
		"diminished_visual_acuity" => $diminished_visual_acuity,
		"diminished_visual_acuity_age" => $diminished_visual_acuity_age,
		"abnormal_fundus" => $abnormal_fundus,
		"other_abnormal_fundus" => $other_abnormal_fundus,
		"other_other_abnormal_fundus" => $other_other_abnormal_fundus,
		"oculomotor_nystagmus" => $oculomotor_nystagmus,
		"describe_oculomotor_nystagmus" => $describe_oculomotor_nystagmus,
		"oculomotor_saccadic_pursuit" => $oculomotor_saccadic_pursuit,
		"describe_oculomotor_saccadic_pursuit" => $describe_oculomotor_saccadic_pursuit,
		"oculomotor_slow_saccades" => $oculomotor_slow_saccades,
		"oculomotor_motor_apraxia" => $oculomotor_motor_apraxia,
		"oculomotor_vertical_ophthalmoplegia" => $oculomotor_vertical_ophthalmoplegia,
		"describe_oculomotor_vertical_ophthalmoplegia" => $describe_oculomotor_vertical_ophthalmoplegia,
		"describe_oculomotor_horizontal_ophthalmoplegia" => $describe_oculomotor_horizontal_ophthalmoplegia,
		"describe_oculomotor_horizontal_ophthalmoplegia" => $describe_oculomotor_horizontal_ophthalmoplegia,
		"intellectual_deterioration" => $intellectual_deterioration,
		"intellectual_deterioration_age" => $intellectual_deterioration_age,
		"intellectual_deterioration_type" => $intellectual_deterioration_type,
		"mental_retardation" => $mental_retardation,
		"mental_retardation_age" => $mental_retardation_age,
		"mental_retardation_type" => $mental_retardation_type,
		"psychiatric_symptoms" => $psychiatric_symptoms,
		"describe_psychiatric_symptoms" => $describe_psychiatric_symptoms,
		"dysphagia" => $dysphagia,
		"describe_dysphagia" => $describe_dysphagia,
		"dysphagia_severity" => $dysphagia_severity,
		"skin_problems" => $skin_problems,
		"describe_skin_problems" => $describe_skin_problems,
		"hearing_impairment" => $hearing_impairment,
		"describe_hearing_impairment" => $describe_hearing_impairment,
		"epilepsy" => $epilepsy,
		"epilepsy_age" => $epilepsy_age,
		"epilepsy_type" => $epilepsy_type,
		"other_medical_complaints" => $other_medical_complaints,
		"score_SARA" => $score_SARA,
		"score_SPRS" => $score_SPRS,
		"score_CCFS" => $score_CCFS,
		"score_OPYNOV" => $score_OPYNOV,
		"score_25FAT" => $score_25FAT,
		"score_UHDRS" => $score_UHDRS,
		"score_AMBUS" => $score_AMBUS,
		"myoclonus" => $myoclonus,
		"diagnostic_cerebellar_ataxia_type" => $diagnostic_cerebellar_ataxia_type,
		"diagnostic_cerebellar_ataxia_form" => $diagnostic_cerebellar_ataxia_form,
		"diagnostic_cerebellar_ataxia_affection" => $diagnostic_cerebellar_ataxia_affection,
		"diagnostic_spastic_parapesis_type" => $diagnostic_spastic_parapesis_type,
		"diagnostic_spastic_parapesis_form" => $diagnostic_spastic_parapesis_form,
		"diagnostic_spastic_parapesis_affection" => $diagnostic_spastic_parapesis_affection,
		"cerebral_mri" => $cerebral_mri,
		"cerebral_mri_cerebrum_specify" => $cerebral_mri_cerebrum_specify,
		"cerebral_mri_cerebellum_specify" => $cerebral_mri_cerebellum_specify,
		"cerebral_mri_brainstem_specify" => $cerebral_mri_brainstem_specify,
		"cerebral_mri_corpus_callosum_specify" => $cerebral_mri_corpus_callosum_specify,
		"medullar_mri" => $medullar_mri,
		"cerebral_mri_upper_spinal_cord_specify" => $cerebral_mri_upper_spinal_cord_specify,
		"emg_ncv_ul" => $emg_ncv_ul,
		"emg_ncv_ll" => $emg_ncv_ll,
		"vep" => $vep,
		"aep" => $aep,
		"mep" => $mep,
		"sep" => $sep,
		"vlcfa" => $vlcfa,
		"alphafoetoprotein" => $alphafoetoprotein,
		"cholesterol" => $cholesterol,
		"serum_protein_electrophoresis" => $serum_protein_electrophoresis,
		"vitamin_E" => $vitamin_E,
		"apolipoprotein_AB" => $apolipoprotein_AB,
		"muscle_biopsy" => $muscle_biopsy,
		"skin_biopsy" => $skin_biopsy,
		"erg" => $erg,
		"fundus_examination" => $fundus_examination,
		"iq" => $iq,
		"urodynamics" => $urodynamics,
		"urine_density" => $urine_density,
		"emg_ncv_ul_specify" => $emg_ncv_ul_specify,
		"emg_ncv_ll_specify" => $emg_ncv_ll_specify,
		"vep_specify" => $vep_specify,
		"aep_specify" => $aep_specify,
		"mep_specify" => $mep_specify,
		"sep_specify" => $sep_specify,
		"vlcfa_specify" => $vlcfa_specify,
		"alphafoetoprotein_specify" => $alphafoetoprotein_specify,
		"cholesterol_specify" => $cholesterol_specify,
		"serum_protein_electrophoresis_specify" => $serum_protein_electrophoresis_specify,
		"vitamin_E_specify" => $vitamin_E_specify,
		"apolipoprotein_AB_specify" => $apolipoprotein_AB_specify,
		"muscle_biopsy_specify" => $muscle_biopsy_specify,
		"skin_biopsy_specify" => $skin_biopsy_specify,
		"erg_specify" => $erg_specify,
		"fundus_examination_specify" => $fundus_examination_specify,
		"iq_value" => $iq_value,
		"urodynamics_specify" => $urodynamics_specify,
		"urine_density_specify" => $urine_density_specify,
		"dna" => $dna,
		"immortalized_cell_lines" => $immortalized_cell_lines,
		"muscle_tissue" => $muscle_tissue,
		"stored_skin_biopsy" => $stored_skin_biopsy,
		"nerve_biopsy" => $nerve_biopsy,
		"other_stored_material" => $other_stored_material 
);

// ~ print_r($hash_variables);

foreach ( $hash_variables as $key => $value ) {
	if ($key != '' and $value != '') {
		$query_update_fiche = "UPDATE `" . $db . "`.`diagnostic` SET `$key` = '$value' WHERE `diagnostic`.`index` = $session";
		// echo "UPDATE `".$db."`.`diagnostic` SET `$key` = '$value' WHERE `diagnostic`.`index` = $nouvel_index";
		mysql_query ( $query_update_fiche ) or die ( "impossible d'updater la fiche : " . mysql_error () );
	}
}

?>

